<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\DbConnection\Model\Model;


/**
 * @property int $id 
 * @property int $user_id 
 * @property int $group_id 
 */
class LinUserGroup extends Model
{
    public bool $timestamps = false;
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected ?string $table = 'lin_user_group';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected array $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected array $casts = ['id' => 'integer', 'user_id' => 'integer', 'group_id' => 'integer'];

    public function permissions()
    {
        return $this->hasMany(LinGroupPermission::class, 'group_id','group_id');
    }

    public function groups(){
        return $this->belongsTo(LinGroup::class,'group_id','id');
    }
}